package com.gis507.test.partitionDemo;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Partitioner;

public class CsvPartition extends Partitioner<Text,CsvBean> {

    @Override
    public int getPartition(Text text, CsvBean csvBean, int numPartitions) {

        int partition;

        String text1 = text.toString();

        if (text1.equals("1")){
            return 0;
        }else if (text1.equals("2")){
            return 1;
        }else if (text1.equals("3")){
            return 2;
        }else if (text1.equals("4")){
            return 3;
        }else{
            return 4;
        }
    }
}
